import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86131
 * Date: 2024-04-18
 * Time: 13:54
 */
public class Demo6 {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = new FileInputStream("d:/test.txt");  //针对硬盘进行操作的,打开一个文件
        //int read = inputStream.read();

        while (true) {
            int b = inputStream.read();
            if(b == -1) {
                //读取完毕
                break;
            }
            System.out.printf("0x%x ",b);
        }
    }
}
